import Vue from 'vue'
import VueRouter from 'vue-router'
import home from "../views/Home"
import login from '../views/Login/Login';
import DeskTop from "../views/desktop"

Vue.use(VueRouter)


const routes = [
  {
    path: '/tologin',
    name: '登录',
    component: login,
    meta: {
      index: 1 //判断index来决定页面的层级
    },
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: "/home",
    name: "首页",
    redirect: "/deskTop",
    component: home,
    meta: {
      index: 1 //判断index来决定页面的层级
    },
    children: [
      {
        path: "/deskTop",
        name: "desktop",
        label: "首页",
        component: DeskTop,
        meta: {
          index: 1 //判断index来决定页面的层级
        },
        // title:"ad"
      },
      {
        children: [],
        code: "sys:clientDetail",
        createTime: 1595926228000,
        icon: "el-icon-document",
        id: 3,
        isHome: "0",
        label: "客户详情",
        name: "clientDetail",
        orderNum: 1,
        parentId: 2,
        path: "/clientDetail",
        type: 1,
        updateTime: 1595926228000,
        url: "/client/ClientManage/ClientDetail",
        component: () => import(`@/views/client/ClientManage/ClientDetail.vue`)
      },
      {
        children: [],
        code: "sys:managerview",
        createTime: 1595928241000,
        icon: "el-icon-document",
        id: 45,
        isHome: "0",
        label: "操作员详情",
        name: "managerview",
        orderNum: 0,
        parentId: 11,
        path: "/managerview",
        type: 1,
        updateTime: 1595928241000,
        url: "/client/OperatorManage/Managerview",
        component: () => import(`@/views/client/OperatorManage/Managerview.vue`)

      },
    {
      "children": [],
      "code": "sys:orderDelete",
      "createTime": 1595927829000,
      "icon": "el-icon-document",
      "id": 8,
      "isHome": "0",
      "label": "撤销订单",
      "name": "orderDelete",
      "orderNum": 3,
      "parentId": 5,
      "path": "/orderDelete",
      "type": 1,
      "updateTime": 1595927829000,
      "url": "/client/OrderManage/OrderDelete",
      component: () => import(`@/views/client/OrderManage/OrderDelete.vue`)
  }, {
    "children": [],
    "code": "sys:orderExchange",
    "createTime": 1595927917000,
    "icon": "el-icon-document",
    "id": 9,
    "isHome": "0",
    "label": "换货订单",
    "name": "orderExchange",
    "orderNum": 4,
    "parentId": 5,
    "path": "/orderExchange",
    "type": 1,
    "updateTime": 1595927917000,
    "url": "/client/OrderManage/OrderExchange",
    component: () => import(`@/views/client/OrderManage/OrderExchange.vue`)

},{
  "children": [],
  "code": "sys:orderUpdate",
  "createTime": 1595927962000,
  "icon": "el-icon-document",
  "id": 10,
  "isHome": "0",
  "label": "退货订单",
  "name": "orderUpdate",
  "orderNum": 5,
  "parentId": 5,
  "path": "/orderUpdate",
  "type": 1,
  "updateTime": 1595927962000,
  "url": "/client/OrderManage/OrderUpdate",
  component: () => import(`@/views/client/OrderManage/OrderUpdate.vue`)

},
    ]

  },




]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
